import 'http://zx4.com:8001/js/base.mjs';
import copy from 'http://zx4.com:8001/js/components/copy.mjs';

window.onCodeCopy = e => {
  copy(e.prev().innerText);
  message('复制成功');
};

document.addEventListener('DOMContentLoaded', () => {
  setTimeout(()=>{
    document.querySelectorAll('pre.pr').forEach(pre => {
      pre.insertAdjacentHTML('beforeEnd', '<span class="pa r12 t8 fs10 pointer" style="color:#687c99" onclick="onCodeCopy(this)">复制</span>');
    });
  }, 0);
});